Recently, demands for safety of automobiles in addition to performance, comfort, fuel economy and the like increases. In order to secure this safety, popularization of advanced driver assistance system (ADAS) is in progress. In this ADAS, a function that a semiconductor device activates a brake and the like when a sensor such as a radar or a camera detects an obstacle is realized. In such semiconductor device mounted on a vehicle, high reliability is generally required. In order to secure this reliability, a built-in self test (BIST) function of detecting a failure of the semiconductor device during operation is required.
For example, a semiconductor device which monitors a phase synchronization circuit which generates an operation clock by multiplying a reference clock from a crystal oscillator and detects a failure is proposed (for example, refer to Patent Document 1). This semiconductor device is based on the premise that the crystal oscillator does not fail; in a case where a ratio between a count value counted in synchronization with the reference clock and a count value counted in synchronization with the operation clock is not a multiplication ratio, this detects the failure of the phase synchronization circuit.